#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
__author-default__ = 'Pup--->>WX_l599p22'
__cttime-default__ = '20170721'
'''

# import pymongo
#
#
# def get_coll():
# 	client = pymongo.MongoClient('127.0.0.1',27017) #连接数据服务
# 	db = client.admin #连接数据库
# 	db.authenticate('admin','@admin521') #用户认证
# 	coll = db.user #连接集合（表），没有则自动创建
#
# 	return coll
#
#
# class User(object):
# 	def __init__(self,name,email):
# 		self.name = name
# 		self.email =email
#
# 	def save(self):
# 		user = {'name':self.name,'email':self.email}
# 		coll = get_coll()
# 		id = coll.insert(user)
# 		print id
#
# 	@staticmethod
# 	def query_all():
# 		users = get_coll().find()
# 		return users

from app import db


class User(db.Document):
	name = db.StringField()
	email = db.StringField()

	def __str__(self):
		return 'name:{}--email:{}'.format(self.name,self.email)